#ifndef __PLAYER_H
#define __PLAYER_H

/*

	PLAYER.H

	The CPlayer class

	OpenGL Game Programming
	Author: Kevin Hawkins
	Date: 3/30/2001
	Description:

*/

#include <typeinfo>
// Phase 19 - Uncomment the following
#ifdef ENABLE_SOUND 
#include "DirectXAudio.h"
#endif
// Phase 15 - Begin
// Uncomment following
#include "sod.h"
#include "ogro.h"
// Phase 15 - End
// Phase 16 - Uncomment
#include "rocket.h"
#include "camera.h"
#include "object.h"
#include "terrain.h"
#include "gui.h"


class CPlayer : public CObject
{
private:
	bool playerDead;
	int kills;
	CCamera *camera;
	CTerrain *terrain;
	bool win;
	bool lose;
	CFont *endText;
	// Phase 19 - Uncomment the following
#ifdef ENABLE_SOUND 
	CDirectXAudio *audioSys;
#endif
	
protected:
	void OnPrepare()
	{
		if (camera)
		{
			position = camera->position;		// the player stays with the camera
			direction = camera->yaw;
			pitch = camera->pitch;
		}
	}

public:
	float direction;	// direction player is facing (same as camera)
	float pitch;		// pitch of player's lookAt vector

	void RackUpAnotherKill();
	int GetKillCount();

	void init();
	void killPlayer();
	bool isPlayerDead();

	CPlayer()
        {
            size = 7.0f;
            camera = NULL;
            terrain = NULL; 
	// Phase 14 - Take these out for now
	// Phase 19 - Uncomment the following
#ifdef ENABLE_SOUND 
	audioSys = NULL;
#endif        
        }
	~CPlayer() {}

	void SetCamera(CCamera *c) { camera = c; }
	void DetachCamera() { camera = NULL; }

	void SetTerrain(CTerrain *t) { terrain = t; }
// Phase 14 - Take out until Rocket is introduced
// Phase 16 - Uncomment
	void FireWeapon();

	void Tick();

// Phase 14 - Take out until AudioSystem in introduced
// Phase 19 - Uncomment the following	
#ifdef ENABLE_SOUND 
	void SetAudioSystem(CDirectXAudio *aSys) { audioSys = aSys; }
#endif        
};

#endif
